package cn.fr4nk.crawler.proxy;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.InitializingBean;

public class ProxyPoolFactory implements InitializingBean {

	private String csvFilePath;
	
	private String prefix;

	@Override
	public void afterPropertiesSet() throws Exception {
		if (StringUtils.isNotEmpty(csvFilePath)){
			BaseProxyPool.getInstance().loadFromCsv(prefix, csvFilePath);
		}
	}


	public String getCsvFilePath() {
		return csvFilePath;
	}


	public String getPrefix() {
		return prefix;
	}


	public BaseProxyPool getProxyPool() {
		return BaseProxyPool.getInstance();
	}


	public void setCsvFilePath(String csvFilePath) {
		this.csvFilePath = csvFilePath;
	}


	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}

}
